<?php

$url = $this->context->id . '/' . $this->context->action->id;
?>
<?= \common\widgets\Asset::widget(['type'=>['colorpicker']])?>
    <div class="ui-layout-center ui-layout-pane">
        <div class="container-div">
            <div class="row">
                <div class="col-sm-12 search-collapse" style="display: block">
                    <div class="layui-card-body">
                        <div class="layui-collapse like-layui-collapse" lay-accordion=""
                             style="border:1px dashed #c4c4c4">
                            <div class="layui-colla-item">
                                <h2 class="layui-colla-title like-layui-colla-title" style="background-color: #fff">操作提示<i
                                        class="layui-icon layui-colla-icon"></i></h2>
                                <div class="layui-colla-content layui-show">
                                    <p>*具体请仔细看配置说明；</p>
                                </div>
                            </div>
                        </div>
                    </div>
                    <form class="form-horizontal" id="form-config-site-site">
                        <div class="form-group">
                            <label class="col-sm-2 control-label is-required">页面主题色：</label>
                            <div class="col-sm-9">
                                <input type="text" id="demo" style="width: 50%;display: inline;" name="theme_color" value="<?= $model->theme_color ?>" class="form-control"
                                       autocomplete="off" required>
                                <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 小程序页面主题色</span>
                            </div>
                        </div>
                        <div class="form-group text-center mt20">
                            <a href="javascript:;" class="btn btn-success btn-mid b5submit_btn"
                               data-target="form-config-site-site" data-title="确定提交小程序信息设置"
                               data-url="<?= \yii\helpers\Url::to(['tran']) ?>">保存</a>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
<?php $this->beginBlock('script'); ?>
    <script>
        $(function() {
            $('#demo').colorpicker({
                allowEmpty:true,//允许为空,显示清楚颜色按钮
                color: $('#demo').val(),//初始化颜色
                showInput: true,//显示输入
                containerClassName: "full-spectrum",
                showInitial: true,//显示初始颜色,提供现在选择的颜色和初始颜色对比
                showPalette: true,//显示选择器面板
                showSelectionPalette: true,//记住选择过的颜色
                showAlpha: true,//显示透明度选择
                maxPaletteSize: 7,//记住选择过的颜色的最大数量
                preferredFormat: "hex"//输入框颜色格式,(hex十六进制,hex3十六进制可以的话只显示3位,hsl,rgb三原
            });
        });
    </script>
<?php $this->endBlock(); ?>